import * as mobx from 'mobx';
import { observable, action, useStrict, computed, asMap } from 'mobx';

export class ShareStore {
    @observable msginfo = [];
    @action
    setMsgInfo = (commonParam, invalidParam, sharer) => {
        const { requestid, f_weaver_belongto_userid, f_weaver_belongto_usertype } = commonParam;
        const { requestname } = invalidParam;
        let sharer_new = sharer ? sharer : f_weaver_belongto_userid;
        let msginfo = [{
            "sharetitle": requestname,
            "linkurl": "/common/chatResource/view.html?resourcetype=0&" + "resourceid=" + requestid + "&isfromchatshare=1&sharer=" +
                f_weaver_belongto_userid + "&firstSharer=" + sharer_new,
            "objectName": "FW:CustomShareMsg",
            "canforward": 1,
            "callbackurl": "/api/common/chatResource/addshare?resourcetype=0" + "&" + "resourceid=" + requestid + "&isfromchatshare=1&firstSharer=" + sharer_new,
            "sharetype": "workflow",
            "shareid": requestid + "",
            "opentype": 1,
            "opentype_pc": 2,
        }]
        this.msginfo = msginfo
    }
}